window.onload = function(){load();}

function load(){
    var str = window.location.href;
    //str.split('/');
    var a = /\d+/.exec(str);
    //$("#directoryBox").append("<p>" + a + "</p><br>" );
    getContent(a);
}

function getContent(k){
    $("#directoryBox").html("");
	$.get(
	 	"http://localhost/registration_system/main/showActInfo/"+k,
            function(data){
            var arr = new Array();
            arr = JSON.parse(data);
            // console.log(arr);
            var j=0;
            for (var i = 0 ; i < arr.content.length; i++) {
                $("#directoryBox").append("<a class='font' href='http://localhost/registration_system/main/content/"+ arr.content[i].iActId+"'>" + arr.content[i].vcActName + "</a><br>" );
                j++;
                if (j>=10) {break;}
            };
        });
}